<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.11.3.js"></script>
    <script>
        $(function(){
           $('#username').blur(function(){
//               console.log();
               $(this).prop('type','password')
           }).focus(function(){
               $(this).prop('type','text')
           })
        })
    </script>
</head>
<body>
<input type="text" value="" id="username">

</body>
</html>